package com.zego.wawaji.ui.bean.user.newuser;

import android.os.Parcel;
import android.os.Parcelable;

import com.zego.wawaji.base.data.BaseData;

import org.json.JSONObject;

/**
 * 新用户7天红包奖励
 * Created by Su on 2018/3/12.
 */
public class SevenRed extends BaseData implements Parcelable {
    private int redStatus;    // 红包状态  -1：错过的  1：可打开  2：已打开
    private int wwCoinZs;     // 已打开时赠送的娃娃币数量

    @Override
    public void parseJson(String jsonStr) {
        JSONObject jsonObject = getJsonObject(jsonStr);

        this.redStatus = jsonObject.optInt("RedStatus");
        this.wwCoinZs = jsonObject.optInt("WwCoinZs");
    }

    public int getRedStatus() {
        return redStatus;
    }

    public int getWwCoinZs() {
        return wwCoinZs;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.redStatus);
        dest.writeInt(this.wwCoinZs);
    }

    public SevenRed() {
    }

    protected SevenRed(Parcel in) {
        this.redStatus = in.readInt();
        this.wwCoinZs = in.readInt();
    }

    public static final Creator<SevenRed> CREATOR = new Creator<SevenRed>() {
        @Override
        public SevenRed createFromParcel(Parcel source) {
            return new SevenRed(source);
        }

        @Override
        public SevenRed[] newArray(int size) {
            return new SevenRed[size];
        }
    };
}
